/*   
 * Copyright (c) 2016-2020 canaanQd. All Rights Reserved.   
 *   
 * This software is the confidential and proprietary information of   
 * canaanQd. You shall not disclose such Confidential Information   
 * and shall use it only in accordance with the terms of the agreements   
 * you entered into with canaanQd.   
 *   
 */ 

package com.lg.config;

import javax.servlet.MultipartConfigElement;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration

public class MultipartConfig {
	
//	@Value("${spring.http.multipart.max-file-size}")
//	private Long maxFileSize;
//	
//	@Value("${spring.http.multipart.max-request-size}")
//	private Long maxRequestSize;
	
	   @Bean
	    public MultipartConfigElement multipartConfigElement() {
	        MultipartConfigFactory factory = new MultipartConfigFactory();
	        factory.setMaxFileSize(30*1024L * 1024L);
	        factory.setMaxRequestSize(30*1024L * 1024L);
	        return factory.createMultipartConfig();
	    }
}
